﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterEuToLiso.master" AutoEventWireup="true" CodeFile="Contato.aspx.cs" Inherits="Contato" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"/>
<script type="text/javascript" src="App_Themes/Eutoliso/js/jquery.nivo.slider.js"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"/>
<script src="App_Themes/Eutoliso/js/google.map.js" type="text/javascript" />
<script type="text/javascript">
 

    $(document).ready(function () {
        //// Start Contact Form ////
        $('#ajaxcontactform').submit(function () { $('input[type=submit]', this).attr('disabled', 'disabled'); });


        $('#ajaxcontactform').submit(

		function parseResponse() {

		    var usersname = $("#name");
		    var usersemail = $("#email");
		    var usersphonenumber = $("#phone");
		    var usersmessage = $("#comment");
		    var contactformid = $("#contactformid");
		    var url = "contact.php";

		    var emailReg = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		    var valid = emailReg.test(usersemail.val());

		    if (!valid) {
		        $("#contactwarning").html('<p class="rejectionalert"><span>Your email is not valid!</span></p>').slideDown().delay(2000).slideUp();
		        $('input[type=submit]', $("#ajaxcontactform")).removeAttr('disabled');
		        return false;
		    }

		    if (usersname.val() == "" || usersname.val() == "Please Insert Your Name") {
		        $("#contactwarning").html('<p class="rejectionalert"><span>Please Insert Your Name!</span></p>').slideDown().delay(2000).slideUp();
		        $('input[type=submit]', $("#ajaxcontactform")).removeAttr('disabled');
		        return false;
		    }
		    if (usersemail.val() == "" || usersemail.val() == "Please Insert Your Email") {
		        $("#contactwarning").html('<p class="rejectionalert"><span>Please Insert Your Email!</span></p>').slideDown().delay(2000).slideUp();
		        $('input[type=submit]', $("#ajaxcontactform")).removeAttr('disabled');
		        return false;
		    }
		    if (usersphonenumber.val() == "" || usersphonenumber.val() == "Please Insert Your Phone Number") {
		        $("#contactwarning").html('<p class="rejectionalert"><span>Please Insert Your Phone Number!</span></p>').slideDown().delay(2000).slideUp();
		        $('input[type=submit]', $("#ajaxcontactform")).removeAttr('disabled');
		        return false;
		    }
		    if (usersmessage.val() == "" || usersmessage.val() == "Please Leave A Message") {
		        $("#contactwarning").html('<p class="rejectionalert"><span>You forgot to leave a message!</span></p>').slideDown().delay(2000).slideUp();
		        $('input[type=submit]', $("#ajaxcontactform")).removeAttr('disabled');
		        return false;
		    }

		    $.post(url, { usersname: usersname.val(), usersemail: usersemail.val(), usersphonenumber: usersphonenumber.val(), usersmessage: usersmessage.val(), contactformid: contactformid.val() }, function (data) {
		        $('#contactajax').html(data);
		        $('#contactajax').slideDown().delay(3000).slideUp();
		        $("#name").val('Please Insert Your Name');
		        $("#email").val('Please Insert Your Email');
		        $("#phone").val('Please Insert Your Phone Number');
		        $("#comment").val('Please Leave A Message');
		        $('input[type=submit]', $("#ajaxcontactform")).removeAttr('disabled');
		    });

		}

	  );
        //// End Contact Form ////

    });
</script> 



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header_search" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="login_header" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="header_pos_menu" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="body_pre_central" Runat="Server">

<div class="titlesnormal">
    
    	<h1>Faça seu anúncio clicando <a href="#">AQUI! </a></h1>
        
       <!-- <span></span> -->
    
    </div>
    <!-- End H1 Title -->
    <!-- Start Main Body Wrap -->
    <div id="main-wrap">
        
        <!-- Start Left Section -->
        <div class="leftsection">

            <!-- Start Google Maps -->
        	<div class="blogwrapstart">
            
            	<div id="map_canvas"></div>
                <span class="box-arrow"></span>
            
            </div>
            <!-- End Google Maps -->
        
        </div>
        <!-- End Left Section -->
        
        <!-- Start Right Section -->
        <div class="rightsection">
            
        	<!-- Start Blog Widget -->
            <div class="blogwidgetstart">
            	<!-- Start Categories Widget -->
            	<div class="widgettitle"><h4>Informações de Contato</h4></div>
                
                <div class="widgetbody">
                
                	<div class="blogcategories">
                    
                    	<div class="contactdetails">
                    
                            <p>contato@eutoliso.com</p>
                            <p>+111 222 333 444</p>
                            <p>Rua da Mãe de Pantanha<br />Mandacarú<br />Mangabeira<br />Cod. Postal 3000 087</p>
                            
                        </div>
                    
                    </div>
                
              </div>
              <!-- End Categories Widget -->
              <span class="box-arrow"></span>
            
            </div>
            <!-- End Blog Widget -->
        
        </div>
        <!-- End Right Section -->

</div>

</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="body_central" Runat="Server">


<!-- Start Full Width -->
        <div class="boxes-full">
        
            <div class="contacttitle">
            
                <h2>Formulário de Contato</h2>
            
            </div>
        
        	<div class="boxes-padding fullpadding">
            
            <div id="contactwarning"></div>
            <div id="contactajax"></div>
            
            <form action="javascript:parseResponse();" method="post" name="ajaxcontactform" id="ajaxcontactform">
            
            	<div class="contacttextarea">
                	<input name="contactformid" id="contactformid" type="hidden" value="1" />
                
                	<fieldset>
                    	<textarea name="comment" id="comment" cols="5" rows="5" class="contacttextarea"onfocus="if (this.value == 'Por favor, deixe aqui a sua mensagem.') {this.value = '';}">Deixe aqui a sua mensagem</textarea>
                    </fieldset>
                
                </div>
                
                <div class="contacttextboxes">
                
                	<fieldset>
                    	<input id="name" name="name" type="text" class="contacttextform" onfocus="if (this.value == 'Please Insert Your Name') {this.value = '';}"value="Insira seu nome"/>
                    </fieldset>
                    
                	<fieldset>
                    	<input id="phone" name="phone" type="text" class="contacttextform" onfocus="if (this.value == 'Please Insert Your Phone Number') {this.value = '';}"value="Insira seu telefone"/>
                    </fieldset>
                    
                	<fieldset>
                    	<input id="email" name="email" type="text" class="contacttextform" onfocus="if (this.value == 'Please Insert Your Email') {this.value = '';}"value="Insira seu e-mail"/>
                    </fieldset>
                    
                	<fieldset>
                    	<input name="enviar" type="submit" class="contactformbutton" value="Enviar"/>
                        <input name="limpar" type="submit" class="contactformbutton" value="Limpar"/>
                    </fieldset>
                
                </div>
                
            </form>
            
            </div>
            
            <span class="box-arrow"></span>
            
        </div>
        <!-- End Full Width -->
        
    

</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="body_pos_central" Runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="body_pos_a_central" Runat="Server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="footer_twitter_realtime" Runat="Server">
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="footer_search" Runat="Server">
</asp:Content>
<asp:Content ID="Content11" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

